//
//  UIView+generateImage.m
//  RunningKit
//
//  Created by Feng dongsheng on 15/5/12.
//  Copyright (c) 2015年 runningkit.me. All rights reserved.
//

#import "UIView+generateImage.h"

@implementation UIView (generateImage)

/**
 *  根据当前view生成UIImage
 *
 *  @return 生成的UIImage
 */
- (UIImage*)generateImage{
    UIGraphicsBeginImageContext(self.bounds.size);
    [self.layer renderInContext:UIGraphicsGetCurrentContext()];
    UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
    UIGraphicsEndImageContext();
    return image;
}

@end
